const userList = []

const saveUser = (user) => {
    userList.push(user)
}

const verify = (user) => {
    for(let i = 0;i<userList.length;i++){
        if(userList[i].username === user.username){
            if(userList[i].password === user.password){
                return userList[i].authority
            }
        }
    }
    return false;
}

const script = { saveUser, verify }

export default script